package com.peycard.persistence.entities;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * The persistent class for the VALID_SESSION database table.
 * 
 */
@Entity
@Table(name="VALID_SESSION")
@NamedQueries({
@NamedQuery(name="tryLogin",query="	SELECT COUNT(v) FROM ValidSession v WHERE v.processingCode = :processingCode and v.us= :us and v.datetime= :datetime"),
@NamedQuery(name="findLogin", query="SELECT v FROM ValidSession v WHERE v.processingCode = :processingCode and v.auditNumber= :auditNumber ")
})
public class ValidSession implements Serializable {
	private static final long serialVersionUID = 1L;

	private Timestamp datetime;

	@Column(name="DATETIME_REQ")
	private String datetimeReq;

	@Id
	@SequenceGenerator(name="ID_VSESSION_GENERATOR", sequenceName="ID_VSESSION_GENERATOR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ID_VSESSION_GENERATOR")
	@Column(name="ID_VALID_SESSION")
	private long idValidSession;

	@Column(name="PROCESSING_CODE")
	private int processingCode;

	@Column(name="RSP_CODE")
	private int rspCode;

	private int status;

	@Column(name="SYSTEM_TRACE_AUDIT_NUMBER")
	private int auditNumber;
	
	@Column(name="US")
	private String us; 
	
    public ValidSession() {
    }

	public Timestamp getDatetime() {
		return this.datetime;
	}

	public void setDatetime(Timestamp datetime) {
		this.datetime = datetime;
	}

	public String getDatetimeReq() {
		return this.datetimeReq;
	}

	public void setDatetimeReq(String datetimeReq) {
		this.datetimeReq = datetimeReq;
	}

	public long getIdValidSession() {
		return this.idValidSession;
	}

	public void setIdValidSession(long idValidSession) {
		this.idValidSession = idValidSession;
	}

	public int getProcessingCode() {
		return this.processingCode;
	}

	public void setProcessingCode(int processingCode) {
		this.processingCode =processingCode ;
	}

	public int getRspCode() {
		return this.rspCode;
	}

	public void setRspCode(int rspCode) {
		this.rspCode = rspCode;
	}

	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getSystemTraceAuditNumber() {
		return this.auditNumber;
	}

	public void setSystemTraceAuditNumber(int auditNumber) {
		this.auditNumber = auditNumber;
	}

	public void setUs(String us) {
		this.us = us;
	}

	public String getUs() {
		return us;
	}

}